/****************** Binary Search Tree *************************\
Author : Liwen Chu
Email : hiensjtu@gmail.com
Comment: Feel free to use any part of this file, however, keeping
of the author infomation would be appreciated.
\***************************************************************/
struct node
{
	int data;
	node *pLeft;
	node *pRight;
};

class BST{

public:
	node *m_root;

public:
	//Constructor from an int array
	BST(int nList[], int nLength);
	~BST();
	
	//pointer to  visit function
	void (*visit)(node*);
	//Inser node
	void Insert(int data, node *root);
	//Use post-order traverse to release all nodes
	void Remove(node *p);
	
	//Pre-order traverse tree
	void PreOrderTraverse(node *root);
	//In-order traverse tree
	void InOrderTraverse(node *root);
	//Post-order traverse tree
	void PostOrderTraverse(node *root);
};